﻿using System;
using System.Windows.Controls;
using System.Windows;

namespace SmartSpace.Silverlight
{
    public sealed class AppSimpleAction : AppAction
    {
        public FrameworkElement Target { get; private set; }

        public AppSimpleAction(FrameworkElement target, Guid id, string name)
            : base(id, name)
        {
            Target = target;
            Target.Visibility = System.Windows.Visibility.Collapsed;
        }

        public override void Enable(bool isEnable)
        {
            if (isEnable)
            {
                Target.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                Target.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
    }
}
